<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%@ page import="com.lmpop.trade.ti_news.*"%>
<%@page import="com.lmpop.trade.ti_channel.*" %>
<%@page import="com.lmpop.trade.ts_category.*" %>
<%@page import="com.lmpop.trade.ti_brand.Ti_brandInfo" %> 
<jsp:useBean id="bean" class="com.lmpop.frame.util.RandomID" scope="page" /> 
 
<%
 
	
	request.setCharacterEncoding("UTF-8");
	Ti_newsInfo  newsinfo = new Ti_newsInfo(); 
	String news_id = bean.GenTradeId ();
	String user_id="";	
	
	if( session.getAttribute("session_user_id") != null )
	{
		user_id = session.getAttribute("session_user_id").toString();
	}
	
	String cust_id = "100000000000000";
	String g_user_name = ""; 
	Ts_categoryInfo ts_categoryInfo = new Ts_categoryInfo();
	String selecttree = ts_categoryInfo.getCategoryTree("Iki043636nk503U","3","");
	Ti_brandInfo  ti_brandInfo = new  Ti_brandInfo();
	 
	//String s_cat_all = ts_categoryInfo.getSelCatByTLevel("2","1");
	//String s_brand_all = ti_brandInfo.getBrandSelectAll(""); 
	
	String s_cat_all  = "";
	String s_brand_all = "";
	
  
  %>
<html>
  <head>
     <title>新增资讯 </title>
	 <link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	 <link href="/program/admin/index/css/thickbox.css" rel="stylesheet" type="text/css">
	 <script type='text/javascript' src='<%=request.getContextPath()%>/dwr/engine.js'></script>
	 <script type='text/javascript' src='<%=request.getContextPath()%>/dwr/util.js'></script>
	 <script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ti_channelInfo.js'></script>
	 <script type="text/javascript" src="news.js"></script>
	 <script type="text/javascript" src="/js/thickbox.js"></script>
	 <script src="/js/jquery.js" type="text/javascript"></script>
	 <script src="iColorPicker.js" type="text/javascript"></script>
	 <script>
	 	 jQuery.noConflict();
	 </script>
	</head>

<body>
	<h1>新增资讯</h1>
	
	<form action="/doTradeReg.do" method="post" name="addForm" id="addForm" target="_self">
  

	<table width="100%" cellpadding="1" cellspacing="1" border="0" class="listtab">
		<tr>
			<td align="right" width="15%">
				资讯标题
		 <font color="red">*</font>			
		 </td>
				<td colspan="3"><input name="title" id="title" type="text" size="60" maxLength="50"/>
				<input name="title_color" id="title_color" type="text" value="#707070" size="10"  class="iColorPicker" title="请选择标题颜色" />				
				</td>
		</tr>

		<tr>
			<td align="right" width="15%" >
				所属分类<font color="red">*</font>			
		  </td>
		  <td colspan="3">
				<select name="cat_attr" id="cat_attr">
				    <option value="">请选择...</option>
					<%=selecttree%>
				</select>
			</td>
		</tr>
      <tr>
			<td align="right" width="10%">
				资讯图片:
			</td>
			<td colspan="3">
				<jsp:include page="/program/inc/uploadImgInc.jsp">
					<jsp:param name="attach_root_id" value="<%=news_id%>" />
				</jsp:include>
			</td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				关键字:			</td>
			<td colspan="3"><input name="news_key" id="news_key" size="60" maxLength="100" type="text" /></td>
		</tr>

				
		<tr>
			<td align="right" width="15%">
				内容摘要:</td>
			<td colspan="3">
			<textarea name="content_sub" id="content_sub" style="color:#999999;" maxLength="1000" rows="5" cols="70"></textarea></td>
		</tr>		
		<tr>
			<td align="right" width="15%">来源:</td>	   
			  <td width="18%"><input name="news_src" id="news_src" type="text" maxlength="50"/></td>
			  <td width="12%" align="right">责任编辑:</td>
			  <td width="40%"><input name="editor" id="editor" type="text" maxlength="50"/></td>
	    </tr>
		
		<tr>
			<td align="right" width="15%">原作者:</td>
			<td>
			   <input name="author" id="author" type="text" maxlength="50"/>
			 </td>
		    <td align="right">文章类型:</td>
		    <td width="40%"><input name="article_cat" type="radio"  value="0" checked />原创
                 <input name="article_cat" type="radio"  value="1"  />转载 </td>
		</tr>	
		
		
		
		<tr>
			<td align="right" width="15%">是否允许评论:</td>
			<td>
		     
			 <input name="is_comment" type="radio"  value="0"  checked />可以
             <input name="is_comment" type="radio"  value="1"   />不可以 
			
			</td>
		    <td align="right"></td>
		    <td width="40%">
			  
			  </td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				外部链接:</td>
			<td colspan="3"><input name="out_link" id="out_link" maxLength="60" size="55" type="text" value=""/></td>
		</tr>		
		<tr>
			<td align="right" width="15%">
				资讯内容<font color="red">*</font>			</td>
 
			<td colspan="3">
			
			<textarea name="content" id="content"></textarea>
			<script type="text/javascript" src="/program/plugins/ckeditor/ckeditor.js"></script>
			<script type="text/javascript">
				 CKEDITOR.replace( 'content',{
			   	      filebrowserUploadUrl : '/program/inc/upload.jsp?type=file&attach_root_id=<%=news_id%>',      
                      filebrowserImageUploadUrl : '/program/inc/upload.jsp?type=img&attach_root_id=<%=news_id%>',      
                      filebrowserFlashUploadUrl : '/program/inc/upload.jsp?type=flash&attach_root_id=<%=news_id%>'     
                 });  
			</script>			
			</td>
		</tr>
	</table>
	
	<table width="100%" cellpadding="1" cellspacing="1" border="0">
 
		 
      
  <tr>
   <td align="center">
        <input name="user_id" id="user_id" type="hidden" value="<%=user_id%>" />
		<input name="state_code" id="state_code" type="hidden" value="c" />
		<input name="news_id" id="news_id" type="hidden" value="<%=news_id%>" />
		<input name="click_num" id="click_num" type="hidden" value="0"/>
		<input type="hidden" name="cust_id" id="cust_id" value="<%=cust_id%>">
		<input name="user_name" id="user_name" value="<%=g_user_name%>" type="hidden" />
		<input type="hidden" name="bpm_id" value="3745" />
        <input class="buttoncss" type="button" name="tradeSub" value="提交" onClick="return chekedform()" />&nbsp;&nbsp;
		<input class="buttoncss" type="button" name="tradeRut" value="返回" onClick="window.location.href='index.jsp';"/>
		 </td>
	</tr>
	</table>
	</form>
</body>

</html>
